package com.link2room.jetfire.entity;

import com.link2room.common.entity.BaseEntity;
import org.hibernate.annotations.DynamicInsert;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.math.BigDecimal;
import java.util.Date;

/**
 * Created by sss on 2016/9/20.
 */
@Entity
@Table(name = "reservation_base")
@DynamicInsert
public class ReservationBase extends BaseEntity{
    public enum  ReservationBase_{
        resSta,memberNo,openid,thirdPaysta,resType,cancelDate,confirmSta,rsvMobile
    }
    /**
     * 活动代码
     */
    private String mcCode;
    /**
     * 产品代码
     */
    private String mcdCode;
    /**
     * 产品名称
     */
    private String mcdName;
    private String mcdNameEn;
    /**
     * 会员号
     */
    private String memberNo;
    /**
     * 会员号
     */
    private String memberLevel;
    /**
     * 微信OPENID
     */
    private String openid;
    /**
     * 房型
     */
    private String rmtype;
    /**
     * 酒店名称
     */
    private String hotelName;
    private String hotelNameEn;
    /**
     * 房型名称
     */
    private String rmtypeName;
    private String rmtypeNameEn;
    /**
     * 入住天数
     */
    private Integer stayNum;
    /**
     * 房数
     */
    private Integer roomNum;
    /**
     * 房号
     */
    private String roomNo;
    /**
     * 到店日期
     */
    private Date arr;
    /**
     * 离店日期
     */
    private Date dep;
    /**
     * 成人数
     */
    private Integer adult;
    /**
     * 小孩数
     */
    private Integer children;
    /**
     * 是否确认状态，NOTCFMD未确认，AUTOCFMD自动确认，AUTOREJ自动拒绝，MANUCFMD人工确认,MANUREJ人工拒绝
     */
    private String confirmSta;
    /**
     * 订单状态 R预订，X取消，I入住，O结账，S挂账
     */
    private String resSta;
    /**
     * 订单来源，WEB官网，WECHAT微信,APP应用程序，TMALL天猫
     */
    private String pbChannel;
    /**
     * 订单类型，PRE预付，CASH现付，CREDIT信用，GROUP团购，FREE免费
     */
    private String resType;
    /**
     * 预订人姓名，仅做备注
     */
    private String rsvMan;
    /**
     * 预订单位名称，仅做备注
     */
    private String rsvCompany;
    /**
     * 预订人手机
     */
    private String rsvMobile;
    /**
     * 预订人电话
     */
    private String rsvTel;
    /**
     * 预订人传真
     */
    private String rsvFax;
    /**
     * 预订人email
     */
    private String rsvEmail;
    /**
     * 预订人 档案Id
     */
    private String rsvProfileNo;
    /**
     * 终端订单号
     */
    private String terminalNo;
    /**
     * 渠道订单号
     */
    private String channelNo;
    /**
     * 联房订单号
     */
    private String l2RNo;
    /**
     * crs订单号
     */
    private String crsNo;
    /**
     * pms订单号
     */
    private String pmsNo;

    /**
     * 预付未支付取消时间
     */
    private Date cancelDate;
    /**
     * PMS房价码
     */
    private String pmsRatecode;

    private BigDecimal amount;

    private String remark;
    private String coMsg;
    /**
     * 是否下单到PMS
     */
    private String isToPms;
    /**
     * 取消类型
     */
    private String cancelType;
    /**
     * 自定义取消规则
     */
    private String cancelRule;
    private String cancelRemark;
    /**
     * 发起取消时间
     */
    private Date realCancelDate;

    @Basic
    @Column(name = "mc_code", nullable = false, length = 64)
    public String getMcCode() {
        return mcCode;
    }

    public void setMcCode(String mcCode) {
        this.mcCode = mcCode;
    }

    @Basic
    @Column(name = "mcd_code", nullable = false, length = 64)
    public String getMcdCode() {
        return mcdCode;
    }

    public void setMcdCode(String mcdCode) {
        this.mcdCode = mcdCode;
    }

    @Basic
    @Column(name = "mcd_name", nullable = false, length = 64)
    public String getMcdName() {
        return mcdName;
    }

    public void setMcdName(String mcdName) {
        this.mcdName = mcdName;
    }

    @Basic
    @Column(name = "mcd_name_en", nullable = true, length = 64)
    public String getMcdNameEn() {
        return mcdNameEn;
    }

    public void setMcdNameEn(String mcdNameEn) {
        this.mcdNameEn = mcdNameEn;
    }

    @Basic
    @Column(name = "member_level", nullable = true, length = 16)
    public String getMemberLevel() {
        return memberLevel;
    }

    public void setMemberLevel(String memberLevel) {
        this.memberLevel = memberLevel;
    }

    @Basic
    @Column(name = "member_no", nullable = true, length = 16)
    public String getMemberNo() {
        return memberNo;
    }

    public void setMemberNo(String memberNo) {
        this.memberNo = memberNo;
    }

    @Basic
    @Column(name = "openid", nullable = true, length = 32)
    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    @Basic
    @Column(name = "room_num", nullable = false)
    public Integer getRoomNum() {
        return roomNum;
    }

    public void setRoomNum(Integer roomNum) {
        this.roomNum = roomNum;
    }

    @Basic
    @Column(name = "room_no", nullable = true, length = 30)
    public String getRoomNo() {
        return roomNo;
    }

    public void setRoomNo(String roomNo) {
        this.roomNo = roomNo;
    }

    @Basic
    @Column(name = "arr", nullable = false)
    public Date getArr() {
        return arr;
    }

    public void setArr(Date arr) {
        this.arr = arr;
    }

    @Basic
    @Column(name = "dep", nullable = false)
    public Date getDep() {
        return dep;
    }

    public void setDep(Date dep) {
        this.dep = dep;
    }

    @Basic
    @Column(name = "adult", nullable = false)
    public Integer getAdult() {
        return adult;
    }

    public void setAdult(Integer adult) {
        this.adult = adult;
    }

    @Basic
    @Column(name = "children", nullable = true)
    public Integer getChildren() {
        return children;
    }

    public void setChildren(Integer children) {
        this.children = children;
    }

    @Basic
    @Column(name = "confirm_sta", nullable = false, length = 20)
    public String getConfirmSta() {
        return confirmSta;
    }

    public void setConfirmSta(String confirmSta) {
        this.confirmSta = confirmSta;
    }

    @Basic
    @Column(name = "res_sta", nullable = false, length = 3)
    public String getResSta() {
        return resSta;
    }

    public void setResSta(String resSta) {
        this.resSta = resSta;
    }

    @Basic
    @Column(name = "pb_channel", nullable = false, length = 20)
    public String getPbChannel() {
        return pbChannel;
    }

    public void setPbChannel(String pbChannel) {
        this.pbChannel = pbChannel;
    }

    @Basic
    @Column(name = "res_type", nullable = false, length = 20)
    public String getResType() {
        return resType;
    }

    public void setResType(String resType) {
        this.resType = resType;
    }

    @Basic
    @Column(name = "rsv_man", nullable = true, length = 60)
    public String getRsvMan() {
        return rsvMan;
    }

    public void setRsvMan(String rsvMan) {
        this.rsvMan = rsvMan;
    }

    @Basic
    @Column(name = "rsv_company", nullable = true, length = 60)
    public String getRsvCompany() {
        return rsvCompany;
    }

    public void setRsvCompany(String rsvCompany) {
        this.rsvCompany = rsvCompany;
    }

    @Basic
    @Column(name = "rsv_mobile", nullable = true, length = 20)
    public String getRsvMobile() {
        return rsvMobile;
    }

    public void setRsvMobile(String rsvMobile) {
        this.rsvMobile = rsvMobile;
    }

    @Basic
    @Column(name = "rsv_tel", nullable = true, length = 20)
    public String getRsvTel() {
        return rsvTel;
    }

    public void setRsvTel(String rsvTel) {
        this.rsvTel = rsvTel;
    }

    @Basic
    @Column(name = "rsv_fax", nullable = true, length = 20)
    public String getRsvFax() {
        return rsvFax;
    }

    public void setRsvFax(String rsvFax) {
        this.rsvFax = rsvFax;
    }

    @Basic
    @Column(name = "rsv_email", nullable = true, length = 255)
    public String getRsvEmail() {
        return rsvEmail;
    }

    public void setRsvEmail(String rsvEmail) {
        this.rsvEmail = rsvEmail;
    }

    @Basic
    @Column(name = "rsv_profile_no", nullable = true, length = 255)
    public String getRsvProfileNo() {
        return rsvProfileNo;
    }

    public void setRsvProfileNo(String rsvProfileNo) {
        this.rsvProfileNo = rsvProfileNo;
    }

    @Basic
    @Column(name = "terminal_no", nullable = true, length = 32)
    public String getTerminalNo() {
        return terminalNo;
    }

    public void setTerminalNo(String terminalNo) {
        this.terminalNo = terminalNo;
    }

    @Basic
    @Column(name = "channel_no", nullable = true, length = 32)
    public String getChannelNo() {
        return channelNo;
    }

    public void setChannelNo(String channelNo) {
        this.channelNo = channelNo;
    }

    @Basic
    @Column(name = "l2r_no", nullable = false, length = 32)
    public String getL2RNo() {
        return l2RNo;
    }

    public void setL2RNo(String l2RNo) {
        this.l2RNo = l2RNo;
    }

    @Basic
    @Column(name = "crs_no", nullable = true, length = 32)
    public String getCrsNo() {
        return crsNo;
    }

    public void setCrsNo(String crsNo) {
        this.crsNo = crsNo;
    }

    @Basic
    @Column(name = "pms_no", nullable = true, length = 32)
    public String getPmsNo() {
        return pmsNo;
    }

    public void setPmsNo(String pmsNo) {
        this.pmsNo = pmsNo;
    }

    @Basic
    @Column(name = "cancel_date", nullable = true)
    public Date getCancelDate() {
        return cancelDate;
    }

    public void setCancelDate(Date cancelDate) {
        this.cancelDate = cancelDate;
    }

    @Basic
    @Column(name = "rmtype", nullable = true, length = 32)
    public String getRmtype() {
        return rmtype;
    }

    public void setRmtype(String rmtype) {
        this.rmtype = rmtype;
    }

    @Basic
    @Column(name = "hotel_name", nullable = true, length = 32)
    public String getHotelName() {
        return hotelName;
    }

    public void setHotelName(String hotelName) {
        this.hotelName = hotelName;
    }

    @Basic
    @Column(name = "hotel_name_en", nullable = true, length = 32)
    public String getHotelNameEn() {
        return hotelNameEn;
    }

    public void setHotelNameEn(String hotelNameEn) {
        this.hotelNameEn = hotelNameEn;
    }

    @Basic
    @Column(name = "rmtype_name", nullable = true, length = 32)
    public String getRmtypeName() {
        return rmtypeName;
    }

    public void setRmtypeName(String rmtypeName) {
        this.rmtypeName = rmtypeName;
    }

    @Basic
    @Column(name = "rmtype_name_en", nullable = true, length = 32)
    public String getRmtypeNameEn() {
        return rmtypeNameEn;
    }

    public void setRmtypeNameEn(String rmtypeNameEn) {
        this.rmtypeNameEn = rmtypeNameEn;
    }

    @Basic
    @Column(name = "stay_num", nullable = true, length = 16)
    public Integer getStayNum() {
        return stayNum;
    }

    public void setStayNum(Integer stayNum) {
        this.stayNum = stayNum;
    }

    @Basic
    @Column(name = "pms_ratecode", nullable = false, length = 16)
    public String getPmsRatecode() {
        return pmsRatecode;
    }

    public void setPmsRatecode(String pmsRatecode) {
        this.pmsRatecode = pmsRatecode;
    }

    @Basic
    @Column(name = "amount", nullable = true, precision = 2)
    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    @Basic
    @Column(name = "remark", nullable = true, length = 255)
    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    @Basic
    @Column(name = "co_msg", nullable = true, length = 255)
    public String getCoMsg() {
        return coMsg;
    }

    public void setCoMsg(String coMsg) {
        this.coMsg = coMsg;
    }

    @Basic
    @Column(name = "is_to_pms", nullable = false, length = 2)
    public String getIsToPms() {
        return isToPms;
    }

    public void setIsToPms(String isToPms) {
        this.isToPms = isToPms;
    }

    @Basic
    @Column(name = "cancel_type", nullable = true, length = 16)
    public String getCancelType() {
        return cancelType;
    }

    public void setCancelType(String cancelType) {
        this.cancelType = cancelType;
    }

    @Basic
    @Column(name = "cancel_rule", nullable = true, length = 255)
    public String getCancelRule() {
        return cancelRule;
    }

    public void setCancelRule(String cancelRule) {
        this.cancelRule = cancelRule;
    }

    @Basic
    @Column(name = "cancel_remark", nullable = true, length = 255)
    public String getCancelRemark() {
        return cancelRemark;
    }

    public void setCancelRemark(String cancelRemark) {
        this.cancelRemark = cancelRemark;
    }

    @Basic
    @Column(name = "real_cancel_date", nullable = true)
    public Date getRealCancelDate() {
        return realCancelDate;
    }

    public void setRealCancelDate(Date realCancelDate) {
        this.realCancelDate = realCancelDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ReservationBase that = (ReservationBase) o;

        if (mcCode != null ? !mcCode.equals(that.mcCode) : that.mcCode != null) return false;
        if (mcdCode != null ? !mcdCode.equals(that.mcdCode) : that.mcdCode != null) return false;
        if (mcdName != null ? !mcdName.equals(that.mcdName) : that.mcdName != null) return false;
        if (memberNo != null ? !memberNo.equals(that.memberNo) : that.memberNo != null) return false;
        if (openid != null ? !openid.equals(that.openid) : that.openid != null) return false;
        if (rmtype != null ? !rmtype.equals(that.rmtype) : that.rmtype != null) return false;
        if (hotelName != null ? !hotelName.equals(that.hotelName) : that.hotelName != null) return false;
        if (rmtypeName != null ? !rmtypeName.equals(that.rmtypeName) : that.rmtypeName != null) return false;
        if (stayNum != null ? !stayNum.equals(that.stayNum) : that.stayNum != null) return false;
        if (roomNum != null ? !roomNum.equals(that.roomNum) : that.roomNum != null) return false;
        if (roomNo != null ? !roomNo.equals(that.roomNo) : that.roomNo != null) return false;
        if (arr != null ? !arr.equals(that.arr) : that.arr != null) return false;
        if (dep != null ? !dep.equals(that.dep) : that.dep != null) return false;
        if (adult != null ? !adult.equals(that.adult) : that.adult != null) return false;
        if (children != null ? !children.equals(that.children) : that.children != null) return false;
        if (confirmSta != null ? !confirmSta.equals(that.confirmSta) : that.confirmSta != null) return false;
        if (resSta != null ? !resSta.equals(that.resSta) : that.resSta != null) return false;
        if (pbChannel != null ? !pbChannel.equals(that.pbChannel) : that.pbChannel != null) return false;
        if (resType != null ? !resType.equals(that.resType) : that.resType != null) return false;
        if (rsvMan != null ? !rsvMan.equals(that.rsvMan) : that.rsvMan != null) return false;
        if (rsvCompany != null ? !rsvCompany.equals(that.rsvCompany) : that.rsvCompany != null) return false;
        if (rsvMobile != null ? !rsvMobile.equals(that.rsvMobile) : that.rsvMobile != null) return false;
        if (rsvTel != null ? !rsvTel.equals(that.rsvTel) : that.rsvTel != null) return false;
        if (rsvFax != null ? !rsvFax.equals(that.rsvFax) : that.rsvFax != null) return false;
        if (rsvEmail != null ? !rsvEmail.equals(that.rsvEmail) : that.rsvEmail != null) return false;
        if (rsvProfileNo != null ? !rsvProfileNo.equals(that.rsvProfileNo) : that.rsvProfileNo != null) return false;
        if (terminalNo != null ? !terminalNo.equals(that.terminalNo) : that.terminalNo != null) return false;
        if (channelNo != null ? !channelNo.equals(that.channelNo) : that.channelNo != null) return false;
        if (l2RNo != null ? !l2RNo.equals(that.l2RNo) : that.l2RNo != null) return false;
        if (crsNo != null ? !crsNo.equals(that.crsNo) : that.crsNo != null) return false;
        if (pmsNo != null ? !pmsNo.equals(that.pmsNo) : that.pmsNo != null) return false;
        if (cancelDate != null ? !cancelDate.equals(that.cancelDate) : that.cancelDate != null) return false;
        if (pmsRatecode != null ? !pmsRatecode.equals(that.pmsRatecode) : that.pmsRatecode != null) return false;
        if (amount != null ? !amount.equals(that.amount) : that.amount != null) return false;
        if (remark != null ? !remark.equals(that.remark) : that.remark != null) return false;
        return coMsg != null ? coMsg.equals(that.coMsg) : that.coMsg == null;

    }

    @Override
    public int hashCode() {
        int result = mcCode != null ? mcCode.hashCode() : 0;
        result = 31 * result + (mcdCode != null ? mcdCode.hashCode() : 0);
        result = 31 * result + (mcdName != null ? mcdName.hashCode() : 0);
        result = 31 * result + (memberNo != null ? memberNo.hashCode() : 0);
        result = 31 * result + (openid != null ? openid.hashCode() : 0);
        result = 31 * result + (rmtype != null ? rmtype.hashCode() : 0);
        result = 31 * result + (hotelName != null ? hotelName.hashCode() : 0);
        result = 31 * result + (rmtypeName != null ? rmtypeName.hashCode() : 0);
        result = 31 * result + (stayNum != null ? stayNum.hashCode() : 0);
        result = 31 * result + (roomNum != null ? roomNum.hashCode() : 0);
        result = 31 * result + (roomNo != null ? roomNo.hashCode() : 0);
        result = 31 * result + (arr != null ? arr.hashCode() : 0);
        result = 31 * result + (dep != null ? dep.hashCode() : 0);
        result = 31 * result + (adult != null ? adult.hashCode() : 0);
        result = 31 * result + (children != null ? children.hashCode() : 0);
        result = 31 * result + (confirmSta != null ? confirmSta.hashCode() : 0);
        result = 31 * result + (resSta != null ? resSta.hashCode() : 0);
        result = 31 * result + (pbChannel != null ? pbChannel.hashCode() : 0);
        result = 31 * result + (resType != null ? resType.hashCode() : 0);
        result = 31 * result + (rsvMan != null ? rsvMan.hashCode() : 0);
        result = 31 * result + (rsvCompany != null ? rsvCompany.hashCode() : 0);
        result = 31 * result + (rsvMobile != null ? rsvMobile.hashCode() : 0);
        result = 31 * result + (rsvTel != null ? rsvTel.hashCode() : 0);
        result = 31 * result + (rsvFax != null ? rsvFax.hashCode() : 0);
        result = 31 * result + (rsvEmail != null ? rsvEmail.hashCode() : 0);
        result = 31 * result + (rsvProfileNo != null ? rsvProfileNo.hashCode() : 0);
        result = 31 * result + (terminalNo != null ? terminalNo.hashCode() : 0);
        result = 31 * result + (channelNo != null ? channelNo.hashCode() : 0);
        result = 31 * result + (l2RNo != null ? l2RNo.hashCode() : 0);
        result = 31 * result + (crsNo != null ? crsNo.hashCode() : 0);
        result = 31 * result + (pmsNo != null ? pmsNo.hashCode() : 0);
        result = 31 * result + (cancelDate != null ? cancelDate.hashCode() : 0);
        result = 31 * result + (pmsRatecode != null ? pmsRatecode.hashCode() : 0);
        result = 31 * result + (amount != null ? amount.hashCode() : 0);
        result = 31 * result + (remark != null ? remark.hashCode() : 0);
        result = 31 * result + (coMsg != null ? coMsg.hashCode() : 0);
        return result;
    }
}
